using System;
using System.Collections.Generic;
using System.Text;

namespace DynamicDNS
{
    /// <summary>
    /// This enumeration contains the possible states, which can be returned by an Update
    /// </summary>
    public enum DynamicDNSStatus
    {
        /// <summary>
        /// The Update has been processed succesfull
        /// </summary>
        OK,
        /// <summary>
        /// The Update resulted in no changes
        /// </summary>
        Unchanged,
        /// <summary>
        /// During the request an error has occured
        /// </summary>
        Error
    }

    /// <summary>
    /// This class contains the status as well as an optional errormessage
    /// </summary>
    public class DynamicDNSUpdateResult
    {
        private string errorMessage;

        private DynamicDNSStatus status;

        /// <summary>
        /// Not allowed, as each result shall have at least a status
        /// </summary>
        private DynamicDNSUpdateResult()
        {
        }

        /// <summary>
        /// Standard constructor for creating a status of an Update-Process
        /// </summary>
        /// <param name="status"></param>
        /// <param name="errorMessage"></param>
        public DynamicDNSUpdateResult(DynamicDNSStatus status, string errorMessage)
        {
            this.errorMessage = errorMessage;
            this.status = status;
        }
        
        /// <summary>
        /// The status as a result of the Update
        /// </summary>
        public DynamicDNSStatus Status
        {
            get { return status; }
        }
	
        /// <summary>
        /// The optional Error Message, if an error occured on the Update
        /// </summary>
        public string ErrorMessage
        {
            get { return errorMessage; }
            
        }
	
    }
}
